Skip to content

Conversation

@gordonwoodhull
Copy link
Contributor

@gordonwoodhull gordonwoodhull commented Jan 13, 2026

  1. Ability to use brand without project and with brand extension.

    If there's no project, create _brand/ in document directory.

  2. quarto use Quarto brand extensions; fixes quarto use brand should also work with Quarto brand extensions #13863

  3. Only copy logo/font files explicitly listed in _brand.yml

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Jan 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@gordonwoodhull
Copy link
Contributor Author

TODO: support brand.yaml schema and types to only select logos and font files referenced from brand.yml

gordonwoodhull and others added 3 commits January 30, 2026 13:01
Fall back to current working directory when no _quarto.yml project
is found, allowing the command to work in single-file mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When `quarto use brand` encounters a brand extension (has _extension.yml
with contributes.metadata.project.brand), it now:
- Detects the extension in the staged directory (root, _extensions/*, or
  _extensions/*/*)
- Uses the extension directory as the source
- Excludes _extension.yml from being copied
- Renames the brand file (e.g., brand.yml) to _brand.yml

Also updates tests:
- Scenario 8 now tests single-file mode (no _quarto.yml)
- Adds Scenario 15 for brand extension installation
- Adds Scenario 16 for brand extension dry-run

Fixes #13863

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
`quarto use brand` now only copies files that are explicitly referenced
in the brand YAML file, rather than copying all files in the source
directory. Referenced files include:

- The brand file itself (_brand.yml)
- Logo paths: logo.small, logo.medium, logo.large (string or light/dark)
- Named logo images: logo.images.<name> (string or {path, alt})
- Font files: typography.fonts[*].files[*] when source: file

Updates test fixtures to use various logo/font reference patterns:
- String form: logo.small: logo.png
- Object with alt: logo.images.main: {path: ..., alt: ...}
- Light/dark variants: logo.small: {light: ..., dark: ...}
- Font string: typography.fonts[*].files: ["path"]
- Font object: typography.fonts[*].files: [{path, weight, style}]

Adds unreferenced files to fixtures to verify they are NOT copied:
- README.md, unused-styles.css, notes.txt, template.html
- fonts/unused-italic.woff2, images/extra-icon.png

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gordonwoodhull gordonwoodhull force-pushed the feature/use-brand-compatibility branch from e0e8407 to a251b80 Compare January 30, 2026 19:44
@gordonwoodhull gordonwoodhull changed the title quarto use brand without project and with brand extension quarto use brand improvements Jan 30, 2026
@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Jan 30, 2026

Now it only copies the logos and font files explicitly referenced in _brand.yml, so with @mcanouil's original test case,

% quarto use brand mcanouil/quarto-mcanouil
Check file:///Users/gordon/src/quarto-cli/src/quarto.ts

If you do not trust the authors of the brand, we recommend that you do not install or use the brand.
? Do you trust the authors of this brand (Y/n) › Yes
? Create brand directory /Users/gordon/docs/use-brand/_brand? (Y/n) › Yes
[✓] Downloading
[✓] Unzipping
? Proceed with using brand main.tar.gz? (Y/n) › Yes

Preparing brand files...
[✓] Copying files...

Created:
 - _brand.yml
 - logos/logo-dark-path.svg
 - logos/logo-light-path.svg

Also properly deals with brand in a subdirectory, for Quarto extensions:

_extension.yml

contributes:
  metadata:
    project:
      brand: path/to/brand.yml

When a brand extension specifies a brand file in a subdirectory
(e.g., contributes.metadata.project.brand: subdir/brand.yml),
referenced files in that brand.yml are now correctly resolved
relative to the brand file's directory, not the extension root.

For example, if subdir/brand.yml references:
- logo.png → looks for subdir/logo.png
- images/nested-logo.png → looks for subdir/images/nested-logo.png

The target paths in _brand/ preserve the relative structure from
the brand file's perspective:
- subdir/logo.png → _brand/logo.png
- subdir/images/nested-logo.png → _brand/images/nested-logo.png

Adds test fixture and scenario 17 for brand extensions with
subdirectory brand files including nested referenced paths.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gordonwoodhull gordonwoodhull merged commit 67cdc52 into main Jan 30, 2026
92 of 93 checks passed
@gordonwoodhull gordonwoodhull deleted the feature/use-brand-compatibility branch January 30, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quarto use brand should also work with Quarto brand extensions

3 participants